package com.neusoft.springboot02.dao.mapper;

import com.neusoft.springboot02.domain.T_item;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.type.JdbcType;

import java.util.List;

@Mapper
public interface T_itemMapper {

    @Select("select * from t_item")
    @Results(id = "baseResult",value = {
            @Result(id = true,column = "id",property = "id",jdbcType = JdbcType.INTEGER),
            @Result(column = "pname",property = "pname",jdbcType = JdbcType.VARCHAR),
            @Result(column = "price",property = "price",jdbcType = JdbcType.DECIMAL),
            @Result(column = "pnum",property = "pnum",jdbcType = JdbcType.INTEGER),
    })
    List<T_item> find_items();

    int add_items(T_item t_item);

    @Select("select * from t_item")
    @ResultMap("baseResult")
    List<T_item> find_items001();
}
